package com.glsc.ngateway.common.api.flowable.resp;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateDeserializer;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateSerializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.format.annotation.DateTimeFormat;

import java.time.LocalDate;
import java.time.LocalDateTime;

@Data
@EqualsAndHashCode(callSuper = true)
public class ResponseSituationEventDto extends ResponseSituationDto {

    @ApiModelProperty(value = "事件分级")
    private String eventGrade;

    @ApiModelProperty(value = "待整改措施数量")
    private String improveCount;

    @ApiModelProperty(value = "全部整改措施数量")
    private String improveCountAll;

    @ApiModelProperty(value = "是否结束")
    private Integer isClose;

    @ApiModelProperty(value = "事件系统")
    private String systemCode;

    @ApiModelProperty(value = "事件成因")
    private Integer eventCause;

    @ApiModelProperty(value = "事件分类 字典")
    private String eventClass;

    @ApiModelProperty(value = "事件发生时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd")
    @JsonSerialize(using = LocalDateSerializer.class)
    @JsonDeserialize(using = LocalDateDeserializer.class)
    private LocalDate eventHappenTime;

    @ApiModelProperty(value = "事件创建人")
    String flowCreateOperatorName;

    @ApiModelProperty(value = "事件创建人账号OA")
    String flowCreateOperatorAccount;

    @ApiModelProperty(value = "流程创建时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    private LocalDateTime processCreateTime;
}
